package com.suray.wcs.service.hk.agv.bean;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
public class HkAgvTaskSend {

    @JsonProperty("reqCode")
    private String reqCode;
    @JsonProperty("reqTime")
    private String reqTime;
    @JsonProperty("clientCode")
    private String clientCode;
    @JsonProperty("tokenCode")
    private String tokenCode;
    @JsonProperty("taskTyp")
    private String taskTyp;
    @JsonProperty("sceneTyp")
    private String sceneTyp;
    @JsonProperty("ctnrTyp")
    private String ctnrTyp;
    @JsonProperty("ctnrCode")
    private String ctnrCode;
    @JsonProperty("wbCode")
    private String wbCode;
    @JsonProperty("positionCodePath")
    private List<PositionCodePathDTO> positionCodePath;
    @JsonProperty("podCode")
    private String podCode;
    @JsonProperty("podDir")
    private String podDir;
    @JsonProperty("podTyp")
    private String podTyp;
    @JsonProperty("materialLot")
    private String materialLot;
    @JsonProperty("priority")
    private String priority;
    @JsonProperty("agvCode")
    private String agvCode;
    @JsonProperty("taskCode")
    private String taskCode;
    @JsonProperty("data")
    private String data;

    @NoArgsConstructor
    @Data
    public static class PositionCodePathDTO {
        @JsonProperty("positionCode")
        private String positionCode;
        @JsonProperty("type")
        private String type;

        PositionCodePathDTO(String positionCode, String type) {
            this.positionCode = positionCode;
            this.type = type;
        }
    }

    public HkAgvTaskSend() {
        reqCode = "";
        reqTime = "";
        clientCode = "";
        tokenCode = "";
        taskTyp = "";
        sceneTyp = "";
        ctnrTyp = "";
        ctnrCode = "";
        wbCode = "";
        podCode = "";
        podDir = "";
        podTyp = "";
        materialLot = "";
        priority = "";
        agvCode = "";
        taskCode = "";
        data = "";

        positionCodePath = new ArrayList<>();
    }

    public void addPosition(String point) {
        positionCodePath.add(new PositionCodePathDTO(point, "00"));
    }
}
